<template>
  <div class="page">
    <header title="个人简历" @click="BackToBeforePage">
      <h2>
        <i>
          <img src="/resume.svg">简历
        </i>
        <i>My Resume</i>
      </h2>
      <i>
        <i>Tech Otakus Change The World</i>
        <br>
        <i>本简历项目由Vue3构建</i>
      </i>
    </header>
    <div class="contain">
      <section class="left">
        <div class="introduction" title="个人简介">
          <h3>
            <span>个人简介</span>
            <i>Self Introduction</i>
          </h3>
          <h1>姓名:{{ resumeInfo.userInfo.name }}</h1>
          <p>性别:{{ resumeInfo.userInfo.gender }},年龄:{{ resumeInfo.userInfo.age }}，{{ resumeInfo.userInfo.post }}</p>
          <p><span class="age">{{ resumeInfo.userInfo.exp }}</span>开发经验</p>
          <p>
            <img src="@/assets/logos/school.svg" style="width: 18px;" />
            <span class="phone">学历:{{ resumeInfo.userInfo.record }}，毕业时间:{{ resumeInfo.userInfo.graduation }}</span>
          </p>
          <p>
            <img src="@/assets/logos/phone.svg" style="width: 18px;" />
            <span class="phone">手机号(微信):{{ resumeInfo.userInfo.phone }}</span>
          </p>
          <p>
            <img src="@/assets/logos/mail.svg" style="width: 18px;" />
            <a class="link">邮箱:{{ resumeInfo.userInfo.mail }}</a>
          </p>
          <div title="码云地址" class="gitee">
            <img src="@/assets/logos/gitee.svg" />
            <a
              :href="resumeInfo.network.gitee"
              class="link"
              target="_blank"
            >
              <span>码云地址：</span>
              {{ resumeInfo.network.gitee }}
            </a>
          </div>
          <div class="tags">
            <span class="tag" v-for="item in resumeInfo.skill" :key="item">{{ item }}</span>&nbsp;
          </div>
        </div>
        <div class="tech" title="技术栈">
          <h3>
            <span>技术栈</span>
            <i>My Tech</i>
          </h3>
          <div ref="main" class="techCharts"></div>
        </div>
        <div class="techAdv" title="技术优势">
          <h3>
            <span>技术优势</span>
            <i>Tech Advance</i>
          </h3>
          <ul class="techIntr">
            <li v-for="item in resumeInfo.techIntr" :key="item">{{ item }}</li>
          </ul>
        </div>
      </section>
      <section class="right">
        <div class="AboutMe" title="工作经历">
          <h3>
            <span>工作经历</span>
            <i>Work Experience</i>
          </h3>
          <ul class="hobby" v-for="(item,index) in resumeInfo.workExp">
            <li>单 位：{{ item.company }} {{ itemworkTime }}</li>
            <li>职 位：{{ item.position }}</li>
            <li>
              内 容：
              <p v-for="items in item.content" :key="items">{{ items }}</p>
            </li>
          </ul>
        </div>
        <div class="exp" title="项目经历">
          <h4>
            <span>项目经历</span>
            <i>Project Experience</i>
          </h4>
          <div>
            <h3>点击卡片可查看相关项目详情</h3>
            <el-timeline>
              <el-timeline-item  placement="top" :hollow="true" :color="item.color" v-for="(item,index) in resumeInfo.project">
                <el-card class="timelineItem">
                  <h4>公司名称 : {{ item.company }}</h4>
                  <p>项目名称 : {{ item.projectName }}</p>
                  <ul :class="'demo'+index">
                    <li>
                      项目描述:{{ item.projectInfo }}
                    </li>
                  </ul>
                  <div class="tags">
                    <span class="tag" v-for="items in item.tags" :key="items">{{ items }}</span>
                  </div>
                  <p>{{ time }}</p>
                  <!-- <p class="jump">点击查看项目</p> -->
                </el-card>
              </el-timeline-item>
            </el-timeline>
          </div>
        </div>
      </section>
    </div>
    <el-divider>
    </el-divider>
    <footer>
      <div class="copyright">
        <span class="text">@Made</span>by
        <span class="mark" style="">&nbsp;{{ resumeInfo.userInfo.ename }}&nbsp;</span>
        <p>
          <span class="text">@Powered</span> with &nbsp;
        <div>
          <img src="@/assets/logos/vue.svg" id="tinyIcon" />
          <img src="@/assets/logos/vite.svg" id="tinyIcon" />
          <img src="@/assets/logos/pinia.svg" id="tinyIcon" />
          <img src="@/assets/logos/gitee.svg" id="tinyIcon" />
          <img src="@/assets/logos/ts.png" id="longIcon" />
          <img src="@/assets/logos/elementPlus.svg" id="longIcon" />
          <img src="@/assets/logos/eChatrs.png" id="longIcon" />
        </div>
        </p>
      </div>
    </footer>
  </div>
</template>

<script setup>
import * as echarts from "echarts"
import { ref, onMounted } from "vue"
import { ElNotification } from "element-plus";
import useStore from '@/store'
import { useRouter } from 'vue-router'
import resumeData from '@/assets/info.ts'
const { methods } = useStore()
const router = useRouter()

onMounted(
  () => {
    init()
    device()
  }
)
const resumeInfo = resumeData;

const device = () => {
  // 获取设备类型
  let deviceType = ref(methods.getDeviceType())
  let device = deviceType.value
  router.push(deviceType.value ? '/homeMobile' : '/home')
  // 根据设备类型弹出消息提示框
  if (deviceType.value) {
    ElNotification({
      title: '页面已更新',
      dangerouslyUseHTMLString: true,
      message: `检测到移动端设备类型为${device[0]}，已为移动端优化；当前页面：主页`,
      type: 'success',
      duration: 2500,
    })
  }
}

// 使用ref创建虚拟DOM引用，使用时用main.value
const main = ref()
function init() {
  // 基于准备好的dom，初始化echarts实例
  const myChart = echarts.init(main.value)
  // 指定图表的配置项和数据
  const option = {
    title: {
      text: 'Skills',
    },
    radar: {
      indicator: [
        { name: 'Javascript', max: 10000, },
        { name: 'CSS', max: 10000 },
        { name: 'Vue3', max: 10000 },
        { name: 'WXApp', max: 10000 },
        { name: 'Axios', max: 10000 },
        { name: 'Vue2', max: 10000 }
      ],
      axisName: {
        color: '#fff',
        backgroundColor: '#666',
        borderRadius: 3,
        padding: [3, 5]
      },
      splitArea: {
        areaStyle: {
          color: ['#77EADF', '#428BD4', '#64AFE9', '#26C3BE'],
          shadowColor: 'rgba(0, 0, 0, 0.2)',
          shadowBlur: 10
        }
      },
    },
    series: [
      {
        name: 'Budget vs spending',
        type: 'radar',
        color: '#ff0000',
        data: [
          {
            value: [7500, 7500, 7500, 7500, 7500, 7500],
            name: '语言基础',
            areaStyle: {
              color: new echarts.graphic.RadialGradient(0.1, 0.1, 1, [
                {
                  color: 'rgba(255, 145, 124, 0.1)',
                  offset: 0
                },
                {
                  color: 'rgba(255, 145, 124, 0.9)',
                  offset: 1
                }
              ])
            }
          },
        ]
      }
    ]
  }
  myChart.setOption(option);
}
const demoI = () => {
  router.push('/demoIMobile')
}

const demoII = () => {
  router.push('/demoIIMobile')
}

const demoIII = () => {
  router.push('/demoIIIMobile')
}

const BackToBeforePage = () => {
  router.push('/mobile')
}
</script>

<style src="@/assets/css/home.css">
</style>

<style lang="less" scoped>
@vw: 3.75vw;

.page {
  position: relative;
  width: (300 / @vw);
  background-color: #f7f7f7;
  margin: auto;
  box-shadow: 0 0 (6 / @vw) #00000083;
  padding: (30 / @vw);
  font-size: (17 / @vw);

  header {
    cursor: pointer;
    margin-bottom: 30 / @vw;

    h2 {
      display: flex;
      justify-content: space-between;
      transition: all .3s;
      border-bottom: (3 / @vw) solid #a0a0a0;
      margin: 0;

      img {
        position: relative;
        top: (4 / @vw);
        width: (25 / @vw);
        height: (25 / @vw);
      }
    }

    &:hover {
      color: #000;

      h2 {
        border-bottom: (3 / @vw) solid #000000;
      }
    }
  }

  .contain {
    .left {
      width: (300 / @vw);

      .introduction {
        transition: all .3s;
        color: #000;
        margin-top: (20 / @vw);

        h3 {
          display: flex;
          justify-content: space-between;
          border-bottom: (1 / @vw) solid #a0a0a0;
          cursor: pointer;
          transition: all .3s;
        }

        .age {
          padding-left: (4 / @vw);
          padding-right: (4 / @vw);
          background-color: #000;
          color: #fff;
          border-radius: (7 / @vw);
          margin-right: (5 / @vw);
        }

        .Cellphone {
          margin-bottom: (12 / @vw);
        }

        .phone {
          position: relative;
          bottom: (2 / @vw);
          margin-left: (5 / @vw);
          margin-right: (30 / @vw);
        }

        .link {
          position: relative;
          bottom: (2 / @vw);
          color: #26C3BE;
          margin-left: (5 / @vw);
          transition: all .3s;
          text-decoration: none;
          cursor: pointer;

          &:hover {
            color: #9900ff;
          }
        }

        .gitee {
          margin-top: (12 / @vw);

          img {
            width: (18 /@vw);
          }

          a {
            bottom: (3 / @vw);

            span {
              color: #000;
            }
          }
        }

        .tags {
          margin-top: (10 / @vw);
          color: #fff;

          .tag {
            display: inline-block;
            height: (25 / @vw);
            line-height: (25 / @vw);
            font-size: (15 / @vw);
            text-align: center;
            border-radius: (20 / @vw);
            border: (2 / @vw) solid #797979;
            padding-left: (5 / @vw);
            padding-right: (5 / @vw);
            background-color: #000;
          }
        }
      }

      .tech {
        transition: all .3s;
        color: #000;
        margin-top: (50 / @vw);

        h3 {
          display: flex;
          justify-content: space-between;
          border-bottom: (1 / @vw) solid #a0a0a0;
          cursor: pointer;
          transition: all .3s;
        }

        .techCharts {
          width: (300 / @vw);
          height: (400 / @vw)
        }
      }

      .techAdv {
        transition: all .3s;
        color: #000;

        h3 {
          display: flex;
          justify-content: space-between;
          border-bottom: (1 / @vw) solid #a0a0a0;
          cursor: pointer;
          transition: all .3s;
        }

        .techIntr {
          font-size: (17 / @vw);
          font-style: italic;
          font-weight: 600;

          li {
            margin-bottom: (18 / @vw);
          }
        }
      }
    }

    .right {
      width: (300 / @vw);

      .AboutMe {
        transition: all .3s;
        color: #000;
        margin-top: (50 / @vw);

        h3 {
          display: flex;
          justify-content: space-between;
          border-bottom: (1 / @vw) solid #a0a0a0;
          cursor: pointer;
          transition: all .3s;
        }

        .hobby {
          font-size: (19 / @vw);
          font-weight: 300;

          li {
            margin-bottom: (18 / @vw);
          }
        }
      }

      .exp {
        transition: all .3s;
        color: #000;
        margin-top: (50 / @vw);

        h3 {
          text-align: center;
          transition: all .3s;
        }

        h4 {
          display: flex;
          justify-content: space-between;
          border-bottom: (1 / @vw) solid #a0a0a0;
          cursor: pointer;
          transition: all .3s;
        }

        ul.timeLine {
          width: (300 / @vw);
          height: (300 / @vw);
        }

        &:hover {
          h3 {
            color: #409EFF;
          }
        }

        .timelineItem {
          position: relative;
          cursor: pointer;

          ul {
            background-color: #fff;
            padding: (10 / @vw) 0 (10 / @vw) (20 / @vw);
            transition: all .5s;

            li {
              color: #000;
              margin-bottom: (10 / @vw);
            }
          }

          .tags {
            margin-top: (10 / @vw);
            margin-left: (20 / @vw);

            .tag {
              display: inline-block;
              height: (15 / @vw);
              line-height: (15 / @vw);
              font-size: (15 / @vw);
              color: #ffffff;
              text-align: center;
              border-radius: (20 / @vw);
              border: (2 / @vw) solid #797979;
              padding-left: (5 / @vw);
              padding-right: (5 / @vw);
              margin-right: (7 / @vw);
              margin-bottom: (5 / @vw);
              background-color: #495057;
            }
          }

          .jump {
            position: absolute;
            top: (50 / @vw);
            right: (80 / @vw);
            opacity: 0;
            font-size: (25 / @vw);
            border: none;
            background-color: #00000000;
            font-style: italic;
            color: #919191;
          }

          &:hover {
            background-color: rgba(0, 0, 0, 0.116);

            .demo0 {
              background-color: #1acae9;
              border-radius: 10px;

              li {
                color: #f7f7f7;
              }
            }

            .demo1 {
              background-color: #491fe2;
              border-radius: 10px;

              li {
                color: #f7f7f7;
              }
            }

            .demo2 {
              background-color: #21d921;
              border-radius: 10px;

              li {
                color: #f7f7f7;
              }
            }

            .demo3 {
              background-color: #4facfe;
              border-radius: 10px;

              li {
                color: #f7f7f7;
              }
            }

            .jump {
              opacity: 1;
            }
          }
        }
      }
    }
  }
}

footer {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;


  .copyright {
    width: (300 / @vw);
    padding: (10 / @vw);
    color: #000;

    img {
      margin-top: (20 / @vw);
      margin-right: (30 / @vw);
    }

    #tinyIcon {
      width: (30 / @vw);
    }

    #longIcon {
      width: (100 / @vw);
    }

    .text {
      font-size: (20 / @vw);
      font-style: italic;
      margin-right: (5 / @vw);
    }

    .mark {
      color: #fff;
      font-size: (20 / @vw);
      font-style: italic;
      background: linear-gradient(90deg, #43e97b, #4facfe);
      border-radius: (5 / @vw);
    }
  }
}
</style>
